//
//  JYShopCarViewModel.h
//  JYFarm
//
//  Created by 花花 on 2017/10/21.
//  Copyright © 2017年 花花. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol JYShopCartViewModelDelegate <NSObject>

@optional
//获取数据
- (void)shopcartRequestDataSuccessWithArray:(NSMutableArray *)dataArray;

//总价格+押金价格+全部数量(没有用上)+(是否全选)
- (void)shopcartAccountForTotalPrice:(double)totalPrice DepositPrice:(double)depositPrice totalCount:(NSInteger)totalCount isAllSelected:(BOOL)isAllSelected;

//提交订单
- (void)shopcartCommitOrderForSelectedProducts:(NSArray *)selectedProducts;

//批量删除
- (void)shopcartWillDeleteSelectedProducts:(NSArray *)selectedProducts;

//清空
- (void)shopcartClearDeleteAllProducts;

@end

@interface JYShopCartViewModel : NSObject

@property(nonatomic,weak) id<JYShopCartViewModelDelegate> delegate;

@property (nonatomic, strong) NSMutableArray *shopcartListArray;    /**< 购物车数据源 */



//请求商品数据
- (void)requestShopcartProductList:(NSMutableArray *)arr;

//选中
- (void)selectProductAtIndexPath:(NSIndexPath *)indexPath isSelected:(BOOL)isSelected;

//数量
- (void)changeCountAtIndexPath:(NSIndexPath *)indexPath count:(NSInteger)count;

//左滑删除商品
- (void)deleteProductTableView:(UITableView *)tableView AtIndexPath:(NSIndexPath *)indexPath;

//是否全部选择
- (void)selectAllProductWithStatus:(BOOL)isSelected;
//批量删除
- (void)deleteSelectedProducts:(NSArray *)selectedArray;

//开始删除  批量删除
- (void)beginToDeleteSelectedProducts;

//删除全部商品
- (void)deleteAllProducts;

//提交订单
- (void)commitOdrerSelectedProducts;

@end
